<ui:composition template="/layout.xhtml"
				xmlns="http://www.w3.org/1999/xhtml"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="conteudo">
		
		<h1>Livros Existentes</h1>
	
			<h:dataTable binding="#{livroBean.datatable}" value="#{livroBean.livros}" var="livro" style="height: 135px; width: 727px; ">
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Titulo" />
					</f:facet>
					<h:outputText value="#{livro.titulo}" />
				</h:column>
				
				<h:column>
					<f:facet name="header">
						<h:outputText value="autor" />
					</f:facet>
					<h:outputText value="#{livro.autor}" />
				</h:column>
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Editora" />
					</f:facet>
					<h:outputText value="#{livro.editora}" >
						<f:convertNumber type="number" pattern="d0" /> 						
					</h:outputText>
				</h:column>
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Categoria" />
					</f:facet>
					<h:outputText value="#{livro.categoria}" />
				</h:column>
			
				<h:column>
					<f:facet name="header">
						<h:outputText value="Ações" />
					</f:facet>
					<h:form>
						<h:commandButton value="Remover" action="#{livroBean.removerLivro}" />
					</h:form>
				</h:column>
			
			</h:dataTable>		
		
	</ui:define>
	
</ui:composition>